<template>
	<view>
		<up-loading-page :loading="true" loadingText="loading..." v-if="showLoading"></up-loading-page>
	</view>
	<view>
		
		<view v-show="!showLoading">
			<view class="viewbox" style="background-color: #fff;"></view>
			<cu-custom :isBack="true">
			<block slot="content">商品兑换</block>
		</cu-custom>
			
			<view class="group1">
				<view class="parse1">
					<image v-if="ok==='1'" src="../../static/成功.png"></image>
					<view v-if="ok==='1'" class="t1">兑换成功</view>
					<view class="parse2">
						<image v-if="ok!=='1'" src="../../static/自动保存_保存失败.png"></image>
						<view v-if="ok!=='1'" class="t1">兑换失败 积分不足</view>
					</view>
				</view>
				
				<button @click="goPageorder" v-if="ok === '1'" class="btn">查看订单</button>
				<button @click="goPage" class="btn1">返回频道首页</button>
			</view>
			
		</view>
	</view>
</template>
<script setup>
import request from '@/common/request.js';
import {
	loadingType
} from '@/utils/type';
import { ref,onMounted } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { url } from '../../uni_modules/uview-plus/libs/function/test';
const showLoading = ref(true)

onMounted(() => {
  setTimeout(() => {
    showLoading.value = false;
  }, 1000);
});

const ok = ref(0)
onLoad((e)=>{
	console.log(e)
	ok.value = e.ok
})

function goPage(){
	uni.navigateTo({
		url:'/pages/index/index'
	})
}
function goPageorder(){
	uni.navigateTo({
		url:'/pages/my-order/my-order'
	})
}

 </script>

<style lang="scss" scoped>
	page{
		background-color: #f6f6f6;
	}
	.group1{
		text-align: center;
		.parse1{
			width: 690rpx;
			height: 700rpx;
			background-color: #fff;
			margin-top: 49rpx;
			margin-left: 30rpx;
			image{
				width: 81rpx;
				height: 80rpx;
				padding-top: 111rpx;
			}
			.t1{
				font-size: 30rpx;
				margin-top: 39rpx;
			}
			.parse2{
				image{
					width: 81rpx;
					height: 80rpx;
					padding-top: 203rpx;
				}
				.t1{
					font-size: 30rpx;
					margin-top: 59rpx;
				}
			}
		}
		
		.btn{
			
			color: #fff;
			background-color: #14288c;
			width: 620rpx;
			height: 90rpx;
			border-radius: 45rpx;
			margin-top: 200rpx;
			
		}
		.btn1{
			
			color: #fff;
			background-color: #b3b3b3;
			width: 620rpx;
			height: 90rpx;
			border-radius: 45rpx;
			margin-top: 30rpx;
		}
	}
	

</style>